/**
 * @author 可乐加糖
 */

var ctx = document.getElementById("gamecanvas").getContext("2d");
var bg = new Image();
bg.src = "imgs/box-bg.jpg";
var imgball = new Image();
imgball.src = "imgs/ball.png";

function init(){
	//面板背景定义
	//ctx.drawImage(bg,0,0,600,700);
	//画一个小球
	var xpoint = 10;
	var timeline = setInterval(function(){
		drawImage(xpoint,20);
		ctx.clearRect(xpoint,20,30,30)
		xpoint += 10;
	},250);
	
	function drawImage(x,y){
		//ctx.drawImage(imgball,x,20,27,28);
		ctx.beginPath();
		ctx.fllStyle = "rgb(255,255,50)";
		ctx.strokeRect(x,20,30,30);
		ctx.fill();
	}
}
